#include "pureclog.h"
#ifdef _MSC_VER
#include <windows.h>
#else
#include <unistd.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int main(int argc, const char *argv[]) {
  pureclog_init(PURECLOG_WARN, PURECLOG_DEBUG, "./mylog.txt", 1 * 1024 * 1024);
  for (int i = 0; i < 500; i++) {
    pureclog_printf(__FILE__, __LINE__, __FUNCTION__, PURECLOG_DEBUG, "%d-hello,world\n", i);
    pureclog_printf(__FILE__, __LINE__, __FUNCTION__, PURECLOG_WARN, "%d-hello,world\n", i);
    pureclog_printf(__FILE__, __LINE__, __FUNCTION__, PURECLOG_INFO, "%d-hello,world\n", i);
    pureclog_printf(__FILE__, __LINE__, __FUNCTION__, PURECLOG_ERR, "%d-hello,world\n", i);

#ifdef _MSC_VER
    Sleep(1);
#else
    usleep(1 * 1000);
#endif
  }
  pureclog_deinit();
  getchar();
  return 0;
}
